-- GENERATED SPELL FOR [Skeleton Mage] --


function spell0_17903(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(31620,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17903', 3000, 1)
end

function spell1_17903(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(31622,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17903', 7000, 1)
end

function spell2_17903(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(31618,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17903', 3000, 1)
end

function Sorts_17903(pUnit, Event)
local choix_sorts_17903 = math.random(0, 2)
if choix_sorts_17903 == 0 then
pUnit:RegisterEvent('spell0_17903', 1, 1)
end
if choix_sorts_17903 == 1 then
pUnit:RegisterEvent('spell1_17903', 1, 1)
end
if choix_sorts_17903 == 2 then
pUnit:RegisterEvent('spell2_17903', 1, 1)
end
end

function mob17903_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17903', math.random(1500, 3000), 1)
end

function mob17903_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17903_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17903_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17903, 1, 'mob17903_Action')
RegisterUnitEvent(17903, 2, 'mob17903_Leave')
RegisterUnitEvent(17903, 3, 'mob17903_Kill')
RegisterUnitEvent(17903, 4, 'mob17903_Die')
